// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="Yaping Xin">
// P/Invoke example.
// </copyright>
// -----------------------------------------------------------------------

namespace Invoke
{
    using System;
    using System.Runtime.InteropServices;
  
/// .Net P/Invoke example.
    internal class Progra
    {
        internal static void Main(string[] args)
        {
           
         
            int result = Sum(2, 3);
            IntPtr node=Test_node(6); 
            int re=Node_Size(node);
            Console.WriteLine("DLL func execute result: {0},{1}", result,re);
            test_denoising("0831.obj","denoising.obj");
            test_make_up_file("11.obj","make_up.obj");
            Console.WriteLine("layered begin");
            float[] zz = new float[4];
            zz[0]=0;zz[1]=2200;zz[2]=2900;zz[3]=5000;
            test_zkhy_layered("qinyang.obj",zz,4);

            
           // test_zkhy_layered_split_one("1.off",2900); 
        }

        [DllImport("pcforcs.dll", EntryPoint = "sum")]
        private static extern int Sum(int a, int b);
        [DllImport("pcforcs.dll",EntryPoint = "test_node")]
        private static extern IntPtr Test_node(int n);
        [DllImport("pcforcs.dll", EntryPoint = "Node_Size")]
        private static extern int Node_Size(IntPtr a);
        [DllImport("pcforcs.dll",EntryPoint="test_denoising",CharSet=CharSet.Ansi)]
        private static extern void test_denoising(string s,string s1);
        // [DllImport("pcforcs.dll",EntryPoint="test_make_up_points",CharSet=CharSet.Ansi)]
        // private static extern IntPtr test_make_up_points (Mesh* mesh,float x_min,float x_max,float y_min,float y_max ,int x_times,int y_times);
        [DllImport("pcforcs.dll",EntryPoint="test_make_up_file",CharSet=CharSet.Ansi)]
        private static extern void test_make_up_file (string filename,string outfilename);
        [DllImport("pcforcs.dll",EntryPoint="test_make_up_points1",CharSet=CharSet.Ansi)]
        private static extern IntPtr test_make_up_points(string s1,string s2,float x_min,float x_max,float y_min,float y_max,int x_times,int y_times);
        [DllImport("pcforcs.dll",EntryPoint="test_zkhy_layered_split_one",CharSet=CharSet.Ansi)]
        private static extern void test_zkhy_layered_split_one(string s,float z);
         
        [DllImport("pcforcs.dll",EntryPoint="test_zkhy_layered",CharSet=CharSet.Ansi)]
        private static extern int test_zkhy_layered(string s,float[] z,int len);
    }
       
}